package top.iflyoung.cim.route.util;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
 * @author liguiyang
 * @description
 * @sine 1.8
 * @date 2021/9/622:27
 **/
public final class TimeUtil {

    private TimeUtil() {

    }

    /**
     * 获取今天的日期
     *
     * @return
     */
    public static final String getToday() {
        LocalDate localDate = LocalDate.now();
        return localDate.format(DateTimeFormatter.BASIC_ISO_DATE);
    }

    /**
     * 获取昨天的日期
     *
     * @return
     */
    public static final String getYesterday() {
        LocalDate localDate = LocalDate.now();
        return localDate.plusDays(-1).format(DateTimeFormatter.BASIC_ISO_DATE);
    }

    /**
     * 获取明天的日期数据
     *
     * @return
     */
    public static final String getTomorrow() {
        LocalDate localDate = LocalDate.now();
        return localDate.plusDays(1).format(DateTimeFormatter.BASIC_ISO_DATE);
    }

}
